export function loadArcGISJSAPI() {
    return new Promise((resolve) => {
      if (window.require) {
        resolve(window.require);
        return;
      }
      
      const script = document.createElement('script');
      script.src = 'https://js.arcgis.com/4.28/';
      script.onload = () => resolve(window.require);
      document.body.appendChild(script);
    });
  }